#include "mydialog.h"
/*废弃*/
MyDialog::MyDialog(QWidget* parent)
    : QDialog(parent)
{
    setWindowTitle("Progress Dialog Example");

    progressDialog_ = new QProgressDialog(this);
    progressDialog_->setWindowTitle("Progress");
    progressDialog_->setLabelText("Progressing...");
    progressDialog_->setRange(0, 100);

    connect(this, &MyDialog::startProgress, progressDialog_, &QProgressDialog::show);
    connect(this, &MyDialog::updateProgress, progressDialog_, &QProgressDialog::setValue);
    connect(this, &MyDialog::finishProgress, progressDialog_, &QProgressDialog::hide);
}

void MyDialog::start()
{
    emit startProgress();
}

void MyDialog::update(int value)
{
    emit updateProgress(value);
}

void MyDialog::finish()
{
    emit finishProgress();
}
